#include "stdafx.h"
#include "CNavigatorElement.h"

CNavigatorElement::CNavigatorElement()
{

}

CNavigatorElement::~CNavigatorElement()
{

}

LPCTSTR CNavigatorElement::GetClass() const
{
	return _T("NavigatorElement");
}

void CNavigatorElement::DoEvent(TEventUI& event)
{
	if (!IsMouseEnabled() && event.Type > UIEVENT__MOUSEBEGIN && event.Type < UIEVENT__MOUSEEND) {
		CContainerUI::DoEvent(event);
		return;
	}

	//if (event.Type == UIEVENT_BUTTONDOWN)
	//{
	//	if (IsEnabled()) {
	//		Activate();
	//		Invalidate();
	//	}
	//	return;
	//}
	//if (event.Type == UIEVENT_KEYDOWN)
	//{
	//	if (IsKeyboardEnabled() && IsEnabled()) {
	//		if (event.chKey == VK_RETURN) {
	//			Activate();
	//			Invalidate();
	//			return;
	//		}
	//	}
	//}
	if (event.Type == UIEVENT_BUTTONDOWN)
	{
		if (IsEnabled()) {
			m_pManager->SendNotify(this, DUI_MSGTYPE_ITEMCLICK);
			//Select();
			Invalidate();
		}
		return;
	}
	

	if (event.Type == UIEVENT_BUTTONUP)
	{
		return;
	}
	if (event.Type == UIEVENT_MOUSEMOVE)
	{
		return;
	}

	CControlUI::DoEvent(event);
}
